<?php
    $chemin_destination = '../images/';    
    move_uploaded_file($_FILES['image']['tmp_name'], $chemin_destination.$_FILES['image']['name']);
    
    $oProduit = new Produit($_POST['libelle'], 
                            $_POST['prix'], 
                            $_FILES['image']['name'],
                            $_POST['desc'], 
                            $_POST['caution'], 
                            $_POST['couleur'], 
                            $_POST['dimensions'], 
                            $_POST['poids'], 
                            $_POST['stock'], 
                            $_POST['lstMarques'],
                            $_POST['lstContextes'],
                            $_POST['dureeMax']);
   
    move_uploaded_file($_FILES['image']['tmp_name'], 'images/' . basename($_FILES['image']['name']));
    $oProduit->ajoutProduit($sql);

    $_SESSION['oProduit']= serialize ($oProduit);
    include('templates/produit/confirmAjout.tpl.php');
?>
